<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="content">新增建议</block>
		</cu-custom>
		
		<view :style="'height:'+screenHeight+'px;'">
			
			<view class="cu-card case">
					<!-- 评价部分 begin -->
					<view class="cu-item shadow">						
						<view class="cu-form-group">
							<textarea  style="height: 50vh;" maxlength="-1" @input="contentChange" 
								placeholder="请您对平台各方面提出建议，非常感谢您~">
							</textarea>
						</view>
						<view class="cu-form-group" style="min-height: 60rpx;">
							<view class="text-sm text-grey">平台收到建议后后会在第一时间通知您!!</view>
						</view>
						<view class="cu-form-group" style="justify-content: center;">
							<button class="cu-btn bg-blue" @tap="submit">提交我的建议</button>
						</view>
					</view>			
			</view>
		
		</view>
		
	</view>
</template>

<script>
	import * as confirm from '@/common/confirm.js'
	import * as upload from '@/common/upload.js'
	
	export default {
		data() {
			return {
				screenHeight:this.s_h_notb-10,
				/* 图片部分 end */
				suggestion:{
					suggestion:""					
				},
			}
		},
		methods: {
			contentChange(val){
				this.suggestion.suggestion=val.detail.value
			},
			//图片上传管理
			async submit(){
				if(this.suggestion.suggestion.length==0){
					confirm.warn("请您输入建议!!!")
					return;
				}
								
				let _this=this
					
				uni.showLoading({
					title:'提交中'
				})
				_this.$api.post('/user/suggestion_submit',_this.suggestion).then(res => {					
					confirm.success(res.msg,()=>{
						uni.hideLoading()
						uni.navigateBack()
					})
				}).catch(error=>{
					uni.hideLoading()
					confirm.info(error.msg)
				})
				
			}
		}		
	}
</script>

<style>
</style>